<html>
<meta charset="utf-8"/>

<!-- ----------------------------------------------------- -->
<head>
<title>Clink v$(CLINK_VERSION)</title>
<style>
    $(INCLUDE docs/clink.css)
</style>
<script type="text/javascript">
    $(INCLUDE docs/marked.min.js)

    function go()
    {
        // Convert markdown to HTML.
        var content = document.getElementById("content");
        var mds = document.getElementsByTagName("md");
        for (var i = 0; i < mds.length; ++i)
        {
            var md = mds[i];
            var div = document.createElement("div");
            div.innerHTML = marked(md.innerHTML);
            div.id = md.getAttribute("_id");
            div.className = md.getAttribute("_class");
            content.insertBefore(div, md);
        }

        // Generate a table of contents from h* tags.
        var toc = document.getElementById("toc");
        var headings = document.querySelectorAll("h3");//,h4");
        for (var i = 0; i < headings.length; ++i)
        {
            var h = headings[i];

            var anchor = document.createElement("a");
            anchor.name = h.id;
            h.parentNode.insertBefore(anchor, h);

            var a = document.createElement("a");
            a.href = "#" + h.id;
            a.innerHTML = h.innerHTML;

            var div = document.createElement("div");
            div.appendChild(a);
            div.className = h.tagName;

            toc.appendChild(div);
        }
    }
    -->
</script>
</head>

<!-- ----------------------------------------------------- -->
<body onload="go();">
    <div id="header">
        <div id="title">Clink v$(CLINK_VERSION)</div>
        <div id="url">
            <a href="http://github.com/mridgers/clink">
                http://github.com/mridgers/clink
            </a>
        </div>
        <div id="author">
            <a href="http://twitter.com/choddlander">Martin Ridgers</a>
        </div>
    </div>
    <div id="toc"></div>
    <div id="content">
        <md _class="section" _id="documentation" style="display: none;">
            $(INCLUDE docs/clink.md)
        </md>
        <h3 id="lua-api">Lua API Reference</h3>
        <div class="section" id="api">
            $(INCLUDE .build/docs/api_html)
        </div>
        <md _class="section" _id="changes" style="display: none;">
            $(INCLUDE CHANGES)
        </md>
    </div>
</body>

</html>
